FROM node:18-alpine

WORKDIR /app

# 设置时区
ENV TZ=Asia/Shanghai

# 设置npm镜像
RUN npm config set registry https://registry.npmmirror.com

# 安装pnpm
RUN npm install -g pnpm

# 设置pnpm镜像
RUN pnpm config set registry https://registry.npmmirror.com
RUN pnpm config set @types:registry https://registry.npmmirror.com

# 复制项目文件
COPY package.json pnpm-lock.yaml ./

# 安装依赖
RUN pnpm install

# 复制源代码
COPY . .

# 构建项目
#RUN pnpm build

EXPOSE 8000

# 启动命令
CMD ["pnpm", "start"]
